<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.yaodian100.ec.member.entity.Member"%>
<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@page import="org.springframework.security.providers.encoding.Md5PasswordEncoder"%>
<%@page import="com.yaodian100.mall.member.util.UserData"%>
<%@page import="com.yaodian100.ec.channel.service.ChannelService"%>
<%@page import="com.yaodian100.ec.channel.entity.ChannelTemplate"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.HashMap"%>
<%@page import="com.yaodian100.core.template.service.TemplateService"%>
<%
Member member = (Member)request.getAttribute("member");
ChannelService channelService = (ChannelService)request.getAttribute("channelService");
TemplateService velocityService = (TemplateService)request.getAttribute("velocityService");
ChannelTemplate entity = channelService.getAvailableChannelTemplate(member.getApplySource(), "CPA");
if(null != entity){
	Map<String, Object> m = new HashMap<String, Object>();
	m.put("member", member);
	m.put("child", channelService.splitChild(member.getChannelChild()));
	if("espnstarpa".equals(member.getApplySource()))
		m.put("encoder", new Md5PasswordEncoder());
	out.write(velocityService.formatByStringTemplate(entity.getContents(), m));
}
%>
<script type="text/javascript">
	var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
	document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F6a111b05a752ae5640228a730c7ff791' type='text/javascript'%3E%3C/script%3E"));
</script>
<!-- Google Code for &#27880;&#20876; Conversion Page -->
<script type="text/javascript">
<!--
var google_conversion_id = 1020816939;
var google_conversion_language = "zh_CN";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "LbmRCP3P2AEQq9zh5gM";
var google_conversion_value = 0;
//-->
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/1020816939/?label=LbmRCP3P2AEQq9zh5gM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>
<script type="text/javascript">
$().ready( function() {
	$("#loginInfo").html('亲爱的 <strong><%=member.getLoginId()%></strong> 会员您好 <a href="javascript:;" id="tologout">【退出登录】</a>');
	$("#tologout").click(function(){
		window.location.replace('<%=ServerValue.getFrontContextPath()%>/logout.do?pathparam='+'<%=ServerValue.getFrontHostname()%>'+window.location.pathname+'<%=StringUtils.isBlank(request.getQueryString())?"":("?"+request.getQueryString())%>');
		return false;
	});
});
</script>